package beans;

import java.io.IOException;
import java.util.Properties;

public class HttpConfig {

	public static String appformUrl;
	public static String configPath;
	public static String ftpParamsUri;
	public static String stateQueryUrl;
	public static String getBaseResourceStateUrl;
	public static String ftpAlgorithmUri;
	public static String hostGroupUrl;
	public static String commitJob;
	public static String filePath;
	public static String tokenUrl;
	public static String stopJob;
	public static String uploadToolUri;
	public static String uploadIP;
	public static String userName;
	public static String passWord;
	public static String priority;
	public static String execNode;
	public static String gpuType;
	public static String resource;
	public static String ccprefix;
	public static String createFtpFolder;
	public static String checkToken;
	public static String algorithmFileUri;
	public static String taskJsonFileUri;
	public static String serverPlatform;
	public static String jobsByStatus;
	public static String modelIds;
	public static boolean fake;
	public static boolean block;
	public static boolean synchronize;

	public static boolean useTempOutput;

	public static String tempOutput;
	public static String wfTempOutput;
	public static String scriptFileUri;
	public static String linuxDriverLetter;
	public static String windowsDriverLetter;
	public static String cpuRemaining;
	public static String memoryRemaining;
	public static String socketLogLevel;
	public static String socketLogFileUri;
    public static String timeLimit;
    public static String serverLogConfig;
    public static String notCplusTaskStateQuery;
    public static String logFileDownloadUrl;
    public static String pauseJob;
    public static String restartJob;
    public static String jobFileUri;
    public static String ftpJobUri;
    public static String getJobRunningState;
    public static String peekJob;
    public static String topJob;
    public static String botJob;
    public static String queueListUrl;
    public static String jobFileXml;
    public static long maxUploadSize;
    public static String fileSystemIP;
    public static String cacheDisk;
    public static String hdfsDisk; 
    public static boolean useCacheDisk;
    public static boolean copyFile;
    public static String grant_type; 
    public static String client_secret; 
    public static String client_id; 
    public static String storageServer;
//    public static String patternFileUri;

    static {
		Properties httpPro = new Properties();
		try {
			httpPro.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("http.properties"));
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		appformUrl = httpPro.getProperty("appformUrl"); 
		commitJob = appformUrl+httpPro.getProperty("commitJobUrl");
		notCplusTaskStateQuery = appformUrl+httpPro.getProperty("notCplusTaskStateQuery");
		logFileDownloadUrl = appformUrl+httpPro.getProperty("logFileDownloadUrl");
		//ftpParamsUri = appformUrl+httpPro.getProperty("ftpParamsUri");
		ftpParamsUri = httpPro.getProperty("ftpParamsUri");
		filePath = httpPro.getProperty("filePathUrl");
		tokenUrl = appformUrl+httpPro.getProperty("tokenUrl");
		stopJob = appformUrl+httpPro.getProperty("stopJobUrl");
		pauseJob = appformUrl+httpPro.getProperty("pauseJobUrl");
        peekJob = appformUrl+httpPro.getProperty("peekJobUrl");
        topJob = appformUrl+httpPro.getProperty("topJobUrl");
        botJob = appformUrl+httpPro.getProperty("botJobUrl");
		restartJob = appformUrl+httpPro.getProperty("restartJobUrl");
		uploadToolUri = httpPro.getProperty("uploadToolUri");
		uploadIP = httpPro.getProperty("uploadIP");
		hostGroupUrl = appformUrl+httpPro.getProperty("hostGroupUrl");
		queueListUrl = appformUrl+httpPro.getProperty("queueListUrl");
		ftpAlgorithmUri = httpPro.getProperty("ftpAlgorithmUri");
		getBaseResourceStateUrl =appformUrl+ httpPro.getProperty("getBaseResourceStateUrl");
		stateQueryUrl =appformUrl+ httpPro.getProperty("stateQueryUrl");
		configPath = httpPro.getProperty("configPath");
		gpuType = httpPro.getProperty("gpuType");
		resource = httpPro.getProperty("resource");
		createFtpFolder = appformUrl+httpPro.getProperty("createFtpFolderUrl");
		checkToken = appformUrl+httpPro.getProperty("checkTokenUrl");
		algorithmFileUri = httpPro.getProperty("algorithmFileUri");
		serverPlatform = httpPro.getProperty("serverPlatform");
		useTempOutput = httpPro.getProperty("useTempOutput").equals("true");
		tempOutput = httpPro.getProperty("tempOutput");
		scriptFileUri = httpPro.getProperty("scriptFileUri");
		linuxDriverLetter = httpPro.getProperty("linuxDriverLetter");
		windowsDriverLetter = httpPro.getProperty("windowsDriverLetter");
		cpuRemaining = httpPro.getProperty("cpuRemaining");
		memoryRemaining = httpPro.getProperty("memoryRemaining");
        jobFileUri = httpPro.getProperty("jobFileUri");
        ftpJobUri = httpPro.getProperty("ftpJobUri");
        getJobRunningState = appformUrl + httpPro.getProperty("getJobRunningState");
        fileSystemIP = httpPro.getProperty("fileSystemIP"); 
        jobFileXml = httpPro.getProperty("jobFileXml");
        cacheDisk = httpPro.getProperty("cacheDisk");
        hdfsDisk = httpPro.getProperty("hdfsDisk");
        useCacheDisk = httpPro.getProperty("useCacheDisk").equals("true");
        copyFile = httpPro.getProperty("copyFile").equals("true");
        taskJsonFileUri=httpPro.getProperty("taskJsonFileUri");
        jobsByStatus=httpPro.getProperty("jobsByStatus");
        modelIds =httpPro.getProperty("modelIds");
        wfTempOutput = httpPro.getProperty("wfTempOutput");
    	storageServer = httpPro.getProperty("storageServer");
//    	patternFileUri = httpPro.getProperty("patternFileUri");
    	
		Properties staticPro = new Properties();
		try {
			staticPro.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("static.properties"));
		} catch (IOException e) {
			e.printStackTrace();
		}
		userName = staticPro.getProperty("workflowUserName");
		passWord = staticPro.getProperty("workflowPassWord");
		priority = staticPro.getProperty("priority");
		execNode = staticPro.getProperty("execNode");
		ccprefix = staticPro.getProperty("ccprefix");
		socketLogFileUri = staticPro.getProperty("socketLogFileUri");
		socketLogLevel = staticPro.getProperty("socketLogLevel");
		fake = staticPro.getProperty("fake").equals("true");
		block = staticPro.getProperty("block").equals("true");
		synchronize = staticPro.getProperty("synchronize").equals("true");
		timeLimit = staticPro.getProperty("userLogTimeLimit");
		serverLogConfig = staticPro.getProperty("serverLogConfig");
		maxUploadSize = Long.parseLong(staticPro.getProperty("maxUploadSize").trim());
		grant_type = staticPro.getProperty("grant_type");
		client_secret = staticPro.getProperty("client_secret");
		client_id = staticPro.getProperty("client_id");
	}
   


}
